package il.technion.cs236369.threadPool;

/**
 * A task from the pool.
 * Holds the normal task and optionally a task to run on timeout or null.
 * @author Gal Lalouche
 *
 */
class PoolTask {
	private final Runnable	runnable;
	private final Runnable	timeoutRunnable;

	/**
	 * Creates a new task
	 * @param runnable The task to run
	 * @param timeoutRunnable An optional task to run on timeout, or null 
	 */
	public PoolTask(Runnable runnable, Runnable timeoutRunnable) {
		super();
		this.runnable = runnable;
		this.timeoutRunnable = timeoutRunnable;
	}

	/**
	 * @return the runnable
	 */
	public Runnable getRunnable() {
		return runnable;
	}

	/**
	 * @return the timeoutRunnable
	 */
	public Runnable getTimeoutRunnable() {
		return timeoutRunnable;
	}

}
